import {createApp} from 'vue'
import App from './App.vue'
import '@/apps/admin/assets/style/style.scss'//后台样式
import "@/apps/admin/assets/theme/index.scss"//后台主题
import "@/assets/style/global.scss"//全局样式
import "@/assets/style/components.scss"//全局组件样式

/**
 * 创建app
 */
const app = createApp(App)

/**
 * 载入element plus UI框架
 */
import ElementPlus from 'element-plus'
import '@/assets/element-plus-theme/index.scss'
app.use(ElementPlus)

/**
 * 挂载全局状态
 */
import store from "@/store/index"
app.use(store)


/**
 * 挂载权限指令
 */
import directive from "./directive/index.js"
app.use(directive)


/**
 * 初始全局配置
 */
import ext from "./ext"
import appStore from "@/store/app";
appStore(store).setExtConfig(ext)


/**
 * 挂在全局组件
 */
import CommonComponents from "./components/index"
app.use(CommonComponents)


/**
 * @link http://element-plus.org/zh-CN/component/icon.html
 * 注册ElementPlus全部图标
 */
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}


/**
 * 注册百度富文本
 */
import VueUeditorWrap from 'vue-ueditor-wrap';
app.use(VueUeditorWrap);


/**
 * @link https://router.vuejs.org/zh/
 * 挂载vue-router v4路由
 */
import router from './router/index'
app.use(router)

/**
 * 挂载到dome节点
 */
app.mount('#app')
